package com.hospital.hospitalserver.controller;

import com.hospital.hospitalserver.entity.FeeItemInfo;
import com.hospital.hospitalserver.service.FeeService;
import com.hospital.hospitalserver.util.Pager;
import com.hospital.hospitalserver.util.Response;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 费用配置与管理相关API接口
 * */
@CrossOrigin
@RestController
@RequiredArgsConstructor
@RequestMapping("/fee")
public class FeeController {
    private final FeeService feeService;


    /**
     * 获取费用类别信息
     * */
    @GetMapping("getFeeCateList")
    public Response getFeeCateList(){
        return feeService.getFeeCateList();
    }

    /**
     * 添加费用信息项
     * */
    @PostMapping("/addFeeItem")
    public Response addFeeItem(@RequestBody FeeItemInfo feeItem){
        return feeService.addFeeItem(feeItem);
    }

    /**
     * 编辑费用信息项
     * */
    @PostMapping("/editFeeItem")
    public Response editFeeItem(@RequestBody FeeItemInfo feeItem){
        return feeService.editFeeItem(feeItem);
    }

    /**
     * 通过检索查询费用信息项分页数据API
     * */
    @PostMapping("/getFeeItemPagerDataBySearch")
    public Response getFeeItemPagerDataBySearch(@RequestBody Pager pager){
        return feeService.getFeeItemPagerDataBySearch(pager);
    }

    /**
     * 统计费用类型数量，启用数量，停用数量，今日更新
     * */
    @GetMapping("/statsFeeItemCount")
    public Response statsFeeItemCount(){
        return feeService.statsFeeItemCount();
    }

    /**
     * 获取费用列表数据
     * 用于排班选项
     * */
    @GetMapping("/getFeeItemList")
    public Response getFeeItemList(){
        return feeService.getFeeItemList();
    }

    /**
     * 获取检查项目中的费用类型数据
     * 用于诊断-开具检查项目
     * */
    @GetMapping("/getCheckFeeItemList")
    public Response getCheckFeeItemList(){
        return feeService.getCheckFeeItemList();
    }
}
